//
//  ZZFNetWorkCore.h
//  zhangzhongfo
//
//  Created by 瞿衡 on 17/1/13.
//  Copyright © 2017年 瞿衡. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <BZBaseNetWorkSDK/BZBaseNetWorkSDK.h>

@interface BZUCLoginService : NSObject


/************************************************************登录注册****************************************************/

/**
 *  获取验证码
 *
 *  @param phoneNum 手机号
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)getSMSCodeByPhoneNumber:(NSString *)phoneNum
                       withImei:(NSString*)imei
                       withCode:(NSInteger) type
                        success:(void(^)(NSString *code , id responseObject))success
                        failure:(void(^)(NSString *code , NSError *error))failure;


/**
 *  验证验证码
 *
 *  @param param   参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */

- (void)checkCodeByParam:(NSDictionary *)param
                 success:(void(^)(NSString *code , id responseObject))success
                 failure:(void(^)(NSString *code , NSError *error))failure;


/**
 *  注册用户
 *
 *  @param param   注册参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)registerUserByParam:(NSDictionary *)param
                    success:(void(^)(NSString *code , id responseObject))success
                    failure:(void(^)(NSString *code , NSError *error))failure;

/**
 *
 *  登录用户(同步)
 *  @param userName 用户名
 *  @param password 密码
 *  return          是否登录成功
 */
- (BOOL)loginByUserName:(NSString *)userName
               password:(NSString *)password
               outError:(NSError *__autoreleasing *)outError;
/**
 *
 *  登录用户
 *  @param userName 用户名
 *  @param password 密码
 *  @param success  成功回调
 *  @param failure  失败回调
 */

- (void)loginByUserName:(NSString *)userName
               password:(NSString *)password
                success:(void(^)(NSString *code , id responseObject))success
                failure:(void(^)(NSString *code,NSError *error))failure;



- (BOOL)loginByUserName:(NSString *)userName
               password:(NSString *)password
               outError:(NSError *__autoreleasing *)outError;

/**
 自动登录
 **/

- (void)  autoLoginWithSuccess:(void(^)(NSString *code , id responseObject))success
                       failure:(void(^)(NSString *code,NSError *error))failure;

/**
 *
 *  注销用户
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)loginOutCurrentUserByHeaderParam:(NSDictionary *)headerParam
                                 Success:(void(^)(NSString *code , id responseObject))success
                                 failure:(void(^)(NSString *code,NSError *error))failure;

/************************************************************找回密码****************************************************/

/**
 *  校验用户名
 *
 *  @param userName 用户名
 *  @param success  成功回调
 *  @param failure  失败回调
 */

- (void)checkoutUserName:(NSString *)userName
                 success:(void(^)(NSString *code , id responseObject))success
                 failure:(void(^)(NSString *code , NSError *error))failure;


/**
 *  获取验证码
 *
 *  @param phoneNum 手机号
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)findSMSCodeOfPhone:(NSString *)phoneNum
                  withImei:(NSString*)imei
                  withCode:(NSInteger) type
                   success:(void(^)(NSString *code , id responseObject))success
                   failure:(void(^)(NSString *code , NSError *error))failure;


/**
 *  校验验证码
 *
 *  @param phoneNum 手机号
 *  @param smsCode  验证码
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)checkSMSCodeOfPhone:(NSString *)phoneNum
                    smsCode:(NSString *)smsCode
                    success:(void(^)(NSString *code , id responseObject))success
                    failure:(void(^)(NSString *code , NSError *error))failure;

/**
 *  重置密码
 *
 *  @param newPassword 新密码
 *  @param success     成功回调
 *  @param failure     失败回调
 */

- (void)resetPasswordWithNewPassword:(NSString *)newPassword
                               phone:(NSString *)phone
                             success:(void(^)(NSString *code , id responseObject))success
                             failure:(void(^)(NSString *code,NSError *error))failure;
/**
 *  修改密码
 *
 *  @param newPassword 新密码
 *  @param oldPassword 旧密码
 *  @param success     成功回调
 *  @param failure     失败回调
 */

- (void)editPasswordWithNewPassword:(NSString *)newPassword
                        oldPassword:(NSString *)oldPassword
                            success:(void(^)(NSString *code , id responseObject))success
                            failure:(void(^)(NSString *code , NSError *error))failure;
/**
 *  获取宗派信息
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)getSectInfoSuccess:(void(^)(NSString *code , id responseObject))success
                   failure:(void(^)(NSString *code , NSError *error))failure;



/**
 1.1.1	修改手机号 - 获取验证码

 /api/purview/user/phone-code
 **/

- (void)findAccountCodeOfPhone:(NSString *)phoneNum withImei:(NSString*)imei withCode:(NSInteger) type
                   success:(void(^)(NSString *code , id responseObject))success
                   failure:(void(^)(NSString *code , NSError *error))failure;

/**
 修改手机号
 
 /api/purview/user/edit-phone
 **/
- (void)  changeAccountWithPhone:(NSString*) phone withCode:(NSString*) code withPassword:(NSString*) pwd success:(void(^)(NSString *code , id responseObject))success
                         failure:(void(^)(NSString *code , NSError *error))failure;

@end
